﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Security.Policy;
using System.Collections;
using FTchina;
namespace FTchina.PureHtml
{
    /// <summary>
    ///BasicInfo 的摘要说明
    /// </summary>
    public class BasicInfo
    {
        public BasicInfo()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }
        public Hashtable GetBaiscInfo()
        {
            if (FTchina.Caching.FTchinaCache.IsExits("TempHastTable"))
            {
                return (Hashtable)HttpRuntime.Cache.Get("TempHastTable");
            }
            else
            {
 

                Hashtable ht = new Hashtable();

                ht.Add("PageTitle", basic.GetSiteName());
                ht.Add("SiteUrl", basic.GetSiteUrl());
                ht.Add("UserMeta", basic.GetUserMeta());
                ht.Add("SiteLogo", basic.GetSiteLogo());


                ht.Add("SiteBanner", basic.GetSiteBanner());
                ht.Add("SiteName", basic.GetSiteName());
                ht.Add("UserBottom", basic.GetUserBottom());
                ht.Add("DateYear", DateTime.Now.Year.ToString());
                ht.Add("HtmlBottom", FTchina.Api.Bottom.show());
                ht.Add("IsHtml", FTchina.basic.IsHtml);



                ht.Add("AdBeforeNews", FTchina.Api.adv.Getbeforenews());
                ht.Add("AdInNews", FTchina.Api.adv.Getinnews());
                ht.Add("AdAfterNews", FTchina.Api.adv.Getafternews());
                ht.Add("AdNewsSide", FTchina.Api.adv.Getnewsside());
                ht.Add("AdBeforeList", FTchina.Api.adv.Getbeforelist());
                ht.Add("AdAfterList", FTchina.Api.adv.Getafterlist());
                ht.Add("AdListSide", FTchina.Api.adv.Getlistside());

 
                ht.Add("NewsList", new FTchina.Api.NewsList());
                ht.Add("Navbar", new FTchina.Api.navbar());
                ht.Add("Pinglun", new FTchina.Api.pinglun());
                ht.Add("State", new FTchina.Api.state());
                ht.Add("Link", new FTchina.Api.FirendLink());
                ht.Add("Tonggao", new FTchina.Api.tonggao());
                ht.Add("Liuyan", new FTchina.Api.liuyan());
                ht.Add("Search", new FTchina.Api.search());

                ht.Add("HtmlPath", new Htmlpath());


                HttpRuntime.Cache.Insert("TempHastTable",ht);
                return ht;
            }
        }

        public VelocityHelper PutAll(VelocityHelper vh)
        {
            Hashtable ht = GetBaiscInfo();
 
            foreach (DictionaryEntry de in ht)
            {
                vh.Put(de.Key.ToString(), de.Value);

            }
            return vh;
        }
    }

    public class Htmlpath
    {
        public string GetHtmlPath(string artid)
        {
            return FTchina.Api.htmlpath.GetFullPath(artid, "1");
        }
    }

}

